<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>快递管理系统-用户登录</title>
<!-- 新 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="${pageContext.request.contextPath}/bootstrap3/css/bootstrap.min.css">
<!-- 可选的Bootstrap主题文件（一般不用引入） -->
<link rel="stylesheet" href="${pageContext.request.contextPath}/bootstrap3/css/bootstrap-theme.min.css">
<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="${pageContext.request.contextPath}/bootstrap3/js/jquery-1.11.2.min.js"></script>
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="${pageContext.request.contextPath}/bootstrap3/js/bootstrap.min.js"></script>
<style>
.col-centered {
	float: none;
	margin: 0 auto;
}
</style>
<script type="text/javascript">
	function checkForm(){
		var userName=document.getElementById("userName").value;
		var password=document.getElementById("password").value;
		if(userName==null || userName==""){
			document.getElementById("login_err").innerHTML="用户名不能为空";
			return false;
		}
		if(password==null || password==""){
			document.getElementById("login_err").innerHTML="密码不能为空";
			return false;
		}
		return true;
	}
</script>
</head>
<body>
	<div class="container">
		<div class="row col-centered">
			<div class="col-md-4 col-md-offset-4">
				<h1>请登录</h1>
			</div>
		</div>
		<div class="row col-centered">
			<div class="col-md-4 col-md-offset-4">
				<form action="${pageContext.request.contextPath}/user/login.do"  method="post" onsubmit="return checkForm()">
					<div class="form-group">
						<span id="login_err" class="sty_txt2">${errorMsg }</span>
					</div>
					<div class="form-group">
						<label for="name">用户名</label> <input type="text"
							class="form-control" id="userName" name="userName" value="${user.userName }" placeholder="">
					</div>
					<div class="form-group">
						<label for="passwd">密码</label> <input type="password"
							class="form-control" id="password"  name="password" value="${user.password }" placeholder="">
					</div>
					<div class="checkbox">
						<label> <input type="checkbox"> 记住
						</label>
					</div>
					<button type="submit" class="btn btn-primary">登录</button>
					<button type="reset" class="btn btn-primary">重置</button>
					<a class="btn btn-default" href="${pageContext.request.contextPath}/user/register.do" role="button">注册</a>
					<a href="${pageContext.request.contextPath}/user/visitor.do">还未注册，游客访问入口</a>
				</form>
			</div>
		</div>
	</div>
</body>
</html>